package ldy.es.domain;

import ldy.es.constant.IndexConstant;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.List;

/**
 * 包名. ldy.es.domain
 * Copyright tiens. All Rights Reserved.
 * 描述详情：user domain对象
 * 创建者：liudy
 * 创建时间：2018/4/1-16:20.
 */
@Document(indexName =IndexConstant.ES_INDEX_NAME_PERSON,
        type = IndexConstant.ES_INDEX_TYPE_NAME_PERSON,replicas = 0
)
public class Person implements Serializable{
    @Id
    private int id;

    @Field(type = FieldType.Date,format = DateFormat.year_month_day)
    private String birthDay;

    @Field(type = FieldType.text)
    private String interest;

    @Field(type = FieldType.keyword)
    private String username;

    @Field(type = FieldType.keyword,store = false)
    private List<String> lbList;

    @Field(type = FieldType.keyword,index = false)
    private String test2;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getBirthDay() {
        return birthDay;
    }

    public void setBirthDay(String birthDay) {
        this.birthDay = birthDay;
    }

    public String getInterest() {
        return interest;
    }

    public void setInterest(String interest) {
        this.interest = interest;
    }

    public List<String> getLbList() {
        return lbList;
    }

    public void setLbList(List<String> lbList) {
        this.lbList = lbList;
    }

    public String getTest2() {
        return test2;
    }

    public void setTest2(String test2) {
        this.test2 = test2;
    }
}
